<template>
    <div>
        <h2 class="h2"><span>伤残立功信息表</span></h2>
        <div>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm information" id="information" accept-charset="UTF-8">
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item class="select2" label="身体残疾情况：" prop="C001">
                            <el-select v-model="ruleForm.C001" placeholder="请选择身体残疾情况">
                                <el-option label="残疾军人" value="1"></el-option>
                                <el-option label="社会残疾人" value="2"></el-option>   
                            </el-select>  
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                         <el-form-item label="是否享受残疾人两项补贴：" prop="C002">
                            <el-radio-group v-model="ruleForm.C002">
                                <el-radio label="有"></el-radio>
                                <el-radio label="无"></el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item class="select2" label="伤残等级：" prop="C003">
                            <el-select v-model="ruleForm.C003" placeholder="请选择伤残等级">
                                <el-option label="一级" value="1"></el-option>
                                <el-option label="二级" value="2"></el-option>   
                                <el-option label="三级" value="3"></el-option>
                                <el-option label="四级" value="4"></el-option>   
                                <el-option label="五级" value="5"></el-option>
                                <el-option label="六级" value="6"></el-option>   
                                <el-option label="七级" value="7"></el-option>
                                <el-option label="八级" value="8"></el-option> 
                                <el-option label="九级" value="9"></el-option>
                                <el-option label="十级" value="10"></el-option>   
                            </el-select>  
                        </el-form-item>           
                    </el-col>
                    <el-col :span="12">    
                         <el-form-item class="select2" label="伤残证件名称：" prop="C005">
                            <el-select v-model="ruleForm.C005" placeholder="请选择伤残证件名称">
                                <el-option label="中华人民共和国残疾军人证" value="1"></el-option>
                                <el-option label="伤残民兵民工证" value="2"></el-option>   
                                <el-option label="因站因公和国因战因公伤残人员证" value="3"></el-option> 
                            </el-select>  
                        </el-form-item>    
                    </el-col>
                </el-row> 
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="伤残证件号码：" prop="C006">
                            <el-input v-model="ruleForm.C006" id="C006" placeholder="请输入伤残证件号码"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="评残时间：" prop="C007">
                            <el-date-picker v-model="ruleForm.C007" type="date" placeholder="评残时间"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item label="是否因精神病评残：" prop="C008">
                            <el-radio-group v-model="ruleForm.C008">
                                <el-radio label="是"></el-radio>
                                <el-radio label="否"></el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item>
                        <el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
                        <el-button @click="resetForm('ruleForm')">重置</el-button>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            dialogImageUrl: '',
            dialogVisible: false,
            ruleForm: { //默认数据
                C001:'', //身体残疾情况
                C002:'',//是否享受残疾人两项补贴
                C003:'', //伤残等级 
                C004:'',//伤残证件名称
                C006:'',//伤残证件号码：
                C007:'',//评残时间
                C008:'',//是否因精神病评残
            },
            rules: {  //规则
                SS: [ //现就业状况
                    { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
                ],
                C001:[  //现就业状况
                    { required: true, message: '请填写现就业状况', trigger: 'blur' },
                ],
                C002:[  //现就业状况
                    { required: true, message: '请填写现就业状况', trigger: 'blur' },
                ],
                C003:[  //伤残等级
                    { required: true, message: '请填写伤残等级', trigger: 'blur' },
                ],
                C004:[  //伤残证件名称
                    { required: true, message: '请填写伤残证件名称', trigger: 'blur' },
                ],
                C006:[  //伤残证件号码：
                    { required: true, message: '请填写伤残证件号码', trigger: 'blur' },
                ],
                C007:[  //评残时间
                    { required: true, message: '请填写评残时间', trigger: 'blur' },
                ],
                C008:[  //是否因精神病评残
                    { required: true, message: '请填写是否因精神病评残', trigger: 'blur' },
                ],
            },
        }
    },
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('submit!');
                    console.log(this.ruleForm)
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
    },
    components:{
        
    }
}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
}
.el-row:last-child {
    margin-bottom: 0;
}
</style>